﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using TSV.Areas.Administration.Models;
using TSV.Models;

namespace TSV.Library.Common
{
    public class PermissionCommon
    {
        public static  bool IsUserAuthorized(int userId, byte moduleId, int[] permissionIds)
        {
            AuthenticateDao auDao = new AuthenticateDao();            
            return auDao.CheckPermission(userId, moduleId, Array.ConvertAll(permissionIds.ToArray(), arr => (int)arr));

        }         
    }
}